<template>
  <div id="GreenLink">
    <x-header slot="header" style="width:100%;position:absolute;left:0;top:0;z-index:100;"
              :left-options="{showBack: showBack, backText: '',preventGoBack:preventGoBack}"
              @on-click-more="showMenus = true"
              @on-click-back="backFun">{{title}}
            <div slot="right">
              <router-link to="/code" v-show="greenRightNum==1">
                <img  src="../../assets/images/shouhoushenqing.png" alt="">
              </router-link>
              <router-link :to="'/gitem/complaint/index?refuse=1&listType=service&orderNum='+num" v-show="greenRightNum==2">
                <img src="../../assets/images/tousu.png" alt="">
              </router-link>
            </div>
    </x-header>
  </div>
</template>

<script>
  import {mapState} from 'vuex'
  import {XHeader, TransferDom, cookie} from 'vux'

  export default {
    directives: {
      TransferDom
    },
    components: {
      XHeader
    },
    computed: {
      ...mapState({
        showBack: state => state.vux.showBack,
        preventGoBack: state => state.vux.preventGoBack,
        urlBack: state => state.vux.urlBack,
        title: state => state.vux.title,
        greenRightNum:state => state.vux.greenRightNum
      }),
      num(){
        if(this.greenRightNum==2){
          var num=this.$route.params.orderNum;
          return num;
        }
      }
    },
    data () {
      return {
      }
    },
    created(){

    },
    mounted(){
      this.numFun()
    },
    methods: {
      backFun() {
        if (this.preventGoBack) {
          // this.$router.push({path: this.urlBack});
          window.location.href = this.urlBack;
        }
      },
      numFun(){
      }
    }
  }
</script>
<style lang="less">
  @green:#51ac33;
  @blue:#1babe3;
  #GreenLink .vux-header-title {
    font-size: 18px;
  }
  #GreenLink .menu {
    margin-right: 70px;
  }
  #GreenLink .menu div {
    color: #000;
  }
  #GreenLink .menu:before {
    right: -70px;
  }
  #GreenLink .vux-header{
    background-color: @green !important;
    .vux-header-title{
      color:#fff !important;
    }
    .vux-header-right a{
      color: #ffffff !important;
    }

  }
  .vux-header .vux-header-left .left-arrow:before{
    border:1px solid #ffffff !important;
    border-width:1px 0 0 1px !important;
  }
 .vux-header .vux-header-right{
   top:13px;
    img{
      width: 24px;
      height: 24px;
    }
  }
</style>
